<template>
	<div>
		<div style="padding-bottom: 240rpx;">
			
			<div class="homework_list">
				
				<template v-if="sneirong.length !== 0">
					
					<view class="sneirong" v-for="(itam,index) in sears()">
						<view class="neirong">
							<view class="nr_t">
								<view class="nr_ts f m-t3"><text>学期名称：</text><text>{{itam.termWorkName}}</text></view>
								<text class="nr_tc m-t3 wcl">指导教师：{{itam.teaName}}</text>
							</view>
							<view class="nr_jd" @tap.stop="getTermReport(itam)" style="width: 150upx; float: left;font-weight: 400;background-color: #B31610;border-radius: 10upx;color: #FFF;text-align: center;">查看报告</view>
							<view class="nr_jd" >{{itam.score}}分</view>
						</view>
					</view>
				</template>
				<template v-else>
					<div style="text-align: center;padding: 30rpx 0">
						暂无数据
					</div>
				</template>
			</div>
		</div>
	</div>
</template>

<script>
	export default {
		data() {
			return {
				workName: "",
				homework_list: [],
				pageNo: 1,
				pageSize: 9999,
				sear: [],
				sneirong: []
			}
		},
		created() {
			this.getTermListStu();
			uni.setNavigationBarTitle({
				title: "学期作业成绩"
			})
		},
		computed: {
			Search() {
				if(this.sear){
					return this.sneirong.filter((value) =>{
						return value.teaName.includes(this.sear)
					})
				}
			}
		},
		methods: {
			sears() {
				if (!this.sear) {
					return this.sneirong;
				}
				return this.Search
			},
			getTermReport(item) {
				uni.navigateTo({
					url: "./sem_report?termWorkId=" + item.termWorkId
				});
			},
			
			getTermListStu() {
				const { pageNo, pageSize } = this;
				this.pyReq(this.$http.getTermListStu, {
					pageNo, pageSize
				}, (res) => {
					this.sneirong = res.result.records;
					this.total = res.result.total;
				});
			},
		}
	}
</script>

<style>
	.homework_item {
		padding: 10rpx 20rpx;
		border: 1px solid #ccc;
		margin: 10rpx 20rpx;
		border-radius: 20rpx;
		padding-bottom: 20rpx;
	}
	.homework_line {
		display: flex;
		overflow: hidden;
		
	}
	.homework_left {
		min-width: 140rpx;
		white-space: nowrap;
		margin-bottom: 10rpx;
	}
	.tr {
		display: block;
		width: 100%;
		text-align: right;
	}
	.style11{
		position: fixed;
		width: 120upx;
		height: 120upx;
		background-color: #B31711;
		z-index: 99;
		color: #FFF;
		font-size: 30upx;
		bottom: 40upx;
		right: 40upx;
		border-radius: 100%;
		box-shadow:2px 2px 5px #000;
	}
	.seo {
		position: relative;
		background: #B31610;
		height: 100upx;
		padding-top: 40upx;
	}
	
	.seos {
		width: 663upx;
		height: 60upx;
		border-radius: 10upx;
		background: #FFFFFF;
		margin: 0 auto;
		font-size: 24upx;
		padding-left: 47upx;
		box-sizing: border-box;
	}
	
	.stb {
		position: absolute;
		right: 74upx;
		top: 56upx;
		width: 28upx;
		height: 30upx;
	}
	
	.sneirong {
		margin: 0 auto;
		border: 1px solid #B31610;
		width: 659upx;
		/* height: 236upx; */
		border-radius: 15upx;
		margin-top: 30upx;
		overflow: hidden;
	}
	
	.neirong {
		margin: 20upx;
	}
	
	.nr_t {
		border-bottom: 1px solid #666666;
		padding-bottom: 20upx;
	}
	
	.nr_t text {
		display: block;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	
	.nr_ts {
		font-size: 27upx;
		font-weight: 700;
		line-height: 70upx;
	}
	
	.nr_ts {
		font-size: 27upx;
		line-height: 70upx;
	}
	
	.nr_jd {
		font-size: 29upx;
		color: #B31610;
		font-weight: 700;
		margin-top: 10upx;
		margin-bottom: 10upx;
		text-align: right;
		width: 120upx;
		float: right;
	}
</style>
